<?php
    header('Content-Type:text/html;charset=utf-8');
    if(!is_array($_GET))
	{
		zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
	}
	if(isset($_GET['order_id'])&&$_GET['order_id']!='')
	{
		$orders_id=$_GET['order_id'];
		require('includes/modules/payment/glbpay/glbpay_application_top.php');
		$ordersql="select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$orders_id."'";

		$orderinfo=$db->Execute($ordersql);
		if($orderinfo->recordCount() > 0 )
		{
			include_once(DIR_WS_MODULES . 'payment/glbpay.php');
			$payment_modules = new glbpay();
			if(isset($payment_modules->form_action_url)&&$payment_modules->form_action_url !='')
			{
				$form_action_url = $payment_modules->form_action_url;
			}
			else
			{
				zen_redirect( zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
			}
			$show='<div>';
			$show.=zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
			$show.=glbpay_button($orders_id);
			$show.='</form>';
			$show.='<div>loading...</div></div>';
			echo  $show;
			echo '<script>document.checkout_confirmation.submit();</script>';
		}
	}
	else
	{
		zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
	}
?>